import { createApp } from 'vue';
import router from './router';
import { createPinia } from 'pinia';

import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import "virtual:svg-icons-register"
import ELementPlus from 'element-plus'
import 'element-plus/dist/index.css';
import './assets/css/icon.css';
import './assets/css/element.css'
import "./assets/css/tailwind.css";

import SvgIcon from "./components/svgIcon/index.vue" // Svg Component

import i18n from './language';

import { permissDirective } from '@/directive'

import App from './App.vue';

const app = createApp(App);
app.use(createPinia());
app.use(router);
app.use(i18n);

permissDirective(app)

app.component("SvgIcon", SvgIcon)

// 注册elementplus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}

app.use(ELementPlus)

app.mount('#app');
